<template>
  <el-card class="box-card">
    <!--头部标题-->
    <div slot="header" class="clearfix">
      <div class="search-header">
        <span>线上热门搜索</span>
        <el-dropdown>
          <span class="el-dropdown-link">
            <i class="el-icon-more"></i>
          </span>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item>黄金糕</el-dropdown-item>
            <el-dropdown-item>双皮奶</el-dropdown-item>
            <el-dropdown-item>蚵仔煎</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
      </div>
    </div>
    <!--图-->
    <div>
    <el-row :gutter="10">
     <el-col :span="12">
       <lineCharts/>
     </el-col>
     <el-col :span="12">
       <lineCharts/>
     </el-col>
    </el-row>
    </div>
    <el-table
      :data="tableData"
      style="width: 100%"
      border
      :default-sort = "{prop: 'date', order: 'descending'}">
      <el-table-column prop="id" label="排名" sortable width="80"></el-table-column>
      <el-table-column prop="keyword" label="搜索关键字" width="220"></el-table-column>
      <el-table-column prop="userNum" label="用户数" sortable ></el-table-column>
      <el-table-column prop="rateWeek" label="周涨幅" sortable ></el-table-column>
    </el-table>
    <!--分页器-->
    <el-pagination
      :page-sizes="[10, 20, 30, 40]"
      :page-size="100"
      align="center"
      layout="prev, pager, next"
      :total="400"
    >
    </el-pagination>
  </el-card>
</template>

<script>
import lineCharts from './lineCharts'
export default {
  name: 'index',
  components:{lineCharts,},
  data(){
    return{
      tableData:[
        {id:1,keyword:'a',userNum:90,rateWeek:59.98},
        {id:2,keyword:'b',userNum:40,rateWeek:59.98},
        {id:3,keyword:'c',userNum:24,rateWeek:59.98},
        {id:4,keyword:'d',userNum:28,rateWeek:59.98},
        ],
    }
  }
}
</script>

<style scoped>
.search-header{
  display: flex;
  justify-content: space-between;
}
.pagination{
  float: right;
}
</style>
